package test.wrc.com.app;

import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends BaseActivity {

    TextView textView;
    Button activity, ui, broadcast, dataStorage;
    ImageButton button4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        activity = (Button) findViewById(R.id.activity);
        activity.setOnClickListener(this);
        ui = (Button) findViewById(R.id.ui);
        ui.setOnClickListener(this);
        broadcast = (Button) findViewById(R.id.broadcast);
        broadcast.setOnClickListener(this);
        dataStorage = (Button) findViewById(R.id.dataStorage);
        dataStorage.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        Intent intent = null;
        switch (v.getId()) {
            case R.id.activity:
                Toast.makeText(this, "ActivityActivity", Toast.LENGTH_SHORT).show();
                intent = new Intent();
                intent.setClass(MainActivity.this, ActivityActivity.class);
                startActivity(intent);
                break;
            case R.id.ui:
                Toast.makeText(this, "UIActivity", Toast.LENGTH_SHORT).show();
                intent = new Intent();
                intent.setClass(MainActivity.this, UIActivity.class);
                startActivity(intent);
                break;
            case R.id.broadcast:
                Toast.makeText(this, "BroadcastActivity", Toast.LENGTH_SHORT).show();
                intent = new Intent();
                intent.setClass(MainActivity.this, BroadcastActivity.class);
                startActivity(intent);
                break;
            case R.id.dataStorage:
                Toast.makeText(this, "DataStorageActivity", Toast.LENGTH_SHORT).show();
                intent = new Intent();
                intent.setClass(MainActivity.this, DataStorageActivity.class);
                startActivity(intent);
                break;
        }
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.add_item:
                Toast.makeText(this, "add_item", Toast.LENGTH_SHORT).show();
                break;
            case R.id.remove_item:
                Toast.makeText(this, "remove_item", Toast.LENGTH_SHORT).show();
                break;
            default:
        }
        return true;
    }

}
